class P10161 {

	private static int length = 44725;
	private static int[] array;

	public static void main(String[] args) {
		
		generate();
		
		String line = readLn();
		while (!"0".equals(line)) {
			process(Integer.parseInt(line));
			line = readLn();
		}
	}

	private static void generate() {
		array = new int[length];
		for (int k = 1; k < length; k++) {
			array[k] = (int) Math.pow(k, 2); 
		}
	}

	private static void process(int i) {
		int anchor = getAnchor(i);
		

		
		if (array[anchor] == i) {
			if (anchor % 2 == 0) {
				System.out.println(anchor + " 1");
			} else {
				System.out.println("1 " + anchor);
			}
			return;
		}

		int right = array[anchor];
		
		int left = array[anchor-1]+1;
		
		long middle = ((long)right + (long)left) /(long)2; 
		
//		System.out.println(">>> anchor: " + anchor);
//		System.out.println(">>> left: " + left);
//		System.out.println(">>> middle: " + middle);
//		System.out.println(">>> right: " + right);
//		System.out.println(">>> i: " + i);
		
		if (middle == i) {
			System.out.println(anchor + " " + anchor);
			return;
		}
		
		long x;
		long y;
		
		if (i > middle) {
			x = anchor;
			y = right - i + 1;
		} else {
			y = anchor;
			x = i - left + 1;
		} 
		
		if (anchor % 2 == 0) {
			System.out.println(x + " " + y);
		} else {
			System.out.println(y + " " + x);
		}
		
	}

	private static int getAnchor(int i) {
		for (int k = 1; k < length; k++) {
			if (array[k-1] < i && array[k] >= i) {
				return k;
			}
		}
		return -1;
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

}
